//
//  BgetModeyTableViewCell.m
//  DistributorAB
//
//  Created by 主事丫环 on 2019/5/23.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "BgetModeyTableViewCell.h"

@implementation BgetModeyTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)refashwithModel:(BgetmoneyModel *)model{
    
    self.orderLb.text = model.Id;
    self.priceLB.text = [NSString stringWithFormat:@"+%.2f",model.count_money];
    
    NSString *timestr  = [self dateConversionTimeStamp:[self nsstringConversionNSDate:model.pay_time]];
    self.timeLb.text = [NSString timeAgoWithDate:timestr];

}

-(NSDate *)nsstringConversionNSDate:(NSString *)dateStr
{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
    NSDate *datestr = [dateFormatter dateFromString:dateStr];
    return datestr;
}
-(NSString *)dateConversionTimeStamp:(NSDate *)date
{
    NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[date timeIntervalSince1970]*1000];
    return timeSp;
}


@end
